package StudentSystem;

import java.util.ArrayList;
import java.util.Scanner;

public class InformationSystem {
    static ArrayList<InformationScanSystem.Data1> teacher,student;
    static Scanner sr = new Scanner(System.in);

    public static int  Administratorzh=123456,Administratorpd=1000;//管理员账户，密码=1000   初始学生账户，密码=0000
    public static int[] rens =new int[2];///人数
    public  static int messagepd=1,shu1,shu2,dkxz=-1;//老师课程数，学生课程数,进入教师(1)/学生(2)编辑系统,端口选择      0管理员端   1学生/老师端
    public static String[][][] Sdata={{{"202209001"},{"12345"},{"王喆"},{"男"},{"001"},{"python"},{"8:00-12:00"},{"教学楼105"}}},
            Tdata={{{"1202209001"},{"12345"},{"吴刚"},{"男"},{"001"},{"python"},{"8:00-12:00"},{"教学楼105"}}};
    public  static   int input1=-1,exit=0,lrenshuT,lrenshuS,stpd=-1,wz=0;//     lrenshuT录入教师人数lrenshuS录入学生人数
    InformationScanSystem Stxtrw=new InformationScanSystem();//学生
    InformationScanSystem Ttxtrw=new InformationScanSystem();//教师
    public void  Write(String star_end){
        if(star_end.equals("star")) {
            Stxtrw.WriteData(1, Sdata, "data/S_object.dat", "list", null);
            Ttxtrw.WriteData(1, Tdata, "data/T_object.dat", "list", null);
        }
        if(star_end.equals("end")) {
            Stxtrw.WriteData(lrenshuS, null, "data/S_object.dat", "all_list", student);
            Ttxtrw.WriteData(lrenshuT, null, "data/S_object.dat", "all_list", teacher);
        }
    }

    public void Read(){
        student=Stxtrw.ReadData("data/S_object.dat");
        rens[0]=student.size();//已有学生人数

        teacher =Ttxtrw.ReadData("data/T_object.dat");
        rens[1]=teacher.size();//已有教师人数
    }
}